package com.guonl.plus.mapper;

import com.guonl.config.mybatis.MybatisRedisCache;
import com.guonl.plus.entity.UserPlus;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.guonl.plus.vo.UserJoinVO;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Options;
import org.mybatis.caches.ehcache.EhcacheCache;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author guonl
 * @since 2024-02-05
 */
//@CacheNamespace(implementation = EhcacheCache.class, eviction = EhcacheCache.class, readWrite = false)
//@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class, readWrite = false)
public interface UserPlusMapper extends BaseMapper<UserPlus> {

    @Options(useCache = true)
    List<UserPlus> getAllUser();


    UserPlus getUserBuId(String userId);

    //不使用缓存，去数据库中查询
    UserPlus getUserBuId2(String userId);

    List<UserPlus> getUserByPhone(String phone);

    void updateById2(UserPlus params);
    List<UserJoinVO> getJoinData(String userId);

}
